﻿package mortal.game.view.copy.groupCopy.view.vipCopy
{
    import Message.DB.Tables.*;
    import Message.Public.*;
    import com.mui.controls.*;
    import fl.data.*;
    import mortal.game.resource.*;
    import mortal.game.resource.tableConfig.*;
    import mortal.game.view.common.*;
    import mortal.game.view.copy.groupCopy.view.*;

    public class VipCopyPanel extends GroupCopyBasePanel
    {
        private var _copyList:GTileList;

        public function VipCopyPanel()
        {
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this.pushUIToDisposeVec(UIFactory.bg(7, 5, 885, 545, this));
            this._copyList = UIFactory.tileList(10, 6, 880, 542, this);
            this._copyList.columnWidth = 290;
            this._copyList.rowHeight = 535;
            this._copyList.horizontalGap = 5;
            this._copyList.setStyle("cellRenderer", VipCopyRender);
            this._copyList.selectable = false;
            this.updateCopyList();
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            this._copyList.dispose(param1);
            this._copyList = null;
            super.disposeImpl(param1);
            return;
        }// end function

        public function updateCopyList() : void
        {
            this._copyList.dataProvider = getCopyDataProvider();
            return;
        }// end function

        public static function getCopyDataProvider() : DataProvider
        {
            var _loc_2:Object = null;
            var _loc_6:TCopy = null;
            var _loc_1:* = new DataProvider();
            var _loc_3:Array = [];
            var _loc_4:* = VipConfig.instance.getVipConfigByType(EVipRecordType._EVipRecordTypeVipCopy);
            var _loc_5:int = 1;
            while (_loc_5 <= 10)
            {
                
                if (_loc_3.indexOf(int(_loc_4["vip" + _loc_5])) == -1)
                {
                    _loc_3.push(int(_loc_4["vip" + _loc_5]));
                }
                _loc_5++;
            }
            _loc_5 = 0;
            while (_loc_5 < _loc_3.length)
            {
                
                _loc_6 = CopyConfig.instance.getCopyInfoByCode(_loc_3[_loc_5]);
                if (_loc_6)
                {
                    _loc_2 = {tCopy:_loc_6, index:_loc_1.length};
                    _loc_1.addItem(_loc_2);
                }
                _loc_5++;
            }
            return _loc_1;
        }// end function

    }
}
